<?php
	// 스타운세에서 궁합 버튼으로
	$artist_idx         = !empty($_POST['artist_idx']) ? $_POST['artist_idx'] : '';
	$your_name          = !empty($_POST['your_name']) ? $_POST['your_name'] : '';
	$your_sex           = !empty($_POST['your_sex']) ? $_POST['your_sex'] : '';
	$your_birth_yyyy    = !empty($_POST['your_birth_yyyy']) ? $_POST['your_birth_yyyy'] : '';
	$your_birth_mm      = !empty($_POST['your_birth_mm']) ? $_POST['your_birth_mm'] : '';
	$your_birth_dd      = !empty($_POST['your_birth_dd']) ? $_POST['your_birth_dd'] : '';
	$your_birth_hh      = !empty($_POST['your_birth_hh']) ? $_POST['your_birth_hh'] : '';
	$your_birth_solunar = !empty($_POST['your_birth_solunar']) ? $_POST['your_birth_solunar'] : '';
	
	$is_star_gunghap = $action_url == '/unse/star/gunghap/result/Y';
?>
			<div class="information">
				<h3><img src="/images/sub/common/sstit_infotit.png" alt="사주정보입력하기" /><em class="text">정확한 사주 정보를 입력하세요</em></h3>
				
				<form name="frm" id="frm" method="post" action="<?=$action_url?>">
					<input type="hidden" name="cate1" id="cate1" value="<?=$category['sub']?>" />
					<input type="hidden" name="cate2" id="cate2" value="<?=$category['cont']?>" />
					<input type="hidden" name="free_yn" id="free_yn" value="<?=$free_yn?>" />
					<input type="hidden" name="login_yn" id="login_yn" value="<?=$sess_userinfo['login_yn']?>" />
					<input type="hidden" name="artist_idx" id="artist_idx" value="<?=$artist_idx?>" />
					<input type="hidden" name="payment_type" id="payment_type" />
					<input type="hidden" name="ticket_idx" id="ticket_idx" />
					<fieldset>
						<legend>나의 사주정보</legend>
						<table width="100%" summary="" cellpadding="0" cellspacing="0">
							<colgroup>
								<col width="85" />
								<col width="*" />
							</colgroup>
							<tbody>
								<tr>
									<td colspan="3" class="title">
										<img src="/images/common/sstit_myinfo.png" alt="나의 사주정보" />
									</td>
								</tr>
								<tr>
									<th scope="row">
										<label for="user_name">이름</label>
									</th>
									<td>
										<input type="text" name="user_name" id="user_name" value="<?=$user['user_name'];?>" class="inpText" />
										<label class="error" for="user_name" generated="true"></label>
									</td>
								</tr>
								<tr>
									<th scope="row">
										<label for="user_sex">성별</label>
									</th>
									<td>
										<input type="radio" name="sex" id="sex_m" value="남" <?=$user['sex'] == 'M' ? "checked='checked'" : '';?> />
										<label for="sex_m">남자</label>
										<input type="radio" name="sex" id="sex_f" value="여" <?=$user['sex'] == 'F' ? "checked='checked'" : '';?> />
										<label for="sex_f">여자</label>
										<label class="error" for="sex" generated="true"></label>
									</td>
								</tr>
								<tr>
									<th scope="row">
										<label for="user_birth">생년월일시</label>
									</th>
									<td>
										<select name="birth_yyyy" id="birth_yyyy" title="출생년도를 선택하세요" class="input_select">
											<option value="">출생년도</option>
<?	for ($year = 1930; $year <= 2012; $year++) : ?>
											<option value="<?=$year?>" <?=$user['birth_yyyy'] == $year ? 'selected="selected"' : '';?>><?=$year?></option>
<?	endfor ?>
										</select>년
										<select name="birth_mm" id="birth_mm" title="출생월을 선택하세요" class="input_select">
											<option value="">출생월</option>
<?	for ($month = 1; $month <= 12; $month++) : ?>
<?		$str_month = str_pad($month, 2, '0', STR_PAD_LEFT); ?>
											<option value="<?=$str_month?>" <?=$user['birth_mm'] == $str_month ? 'selected="selected"' : '';?>><?=$month?></option>
<?	endfor ?>
										</select>월
										<select name="birth_dd" id="birth_dd" title="출생일을 선택하세요" class="input_select bottom">
											<option value="">출생일</option>
<?	for ($day = 1; $day <= 31; $day++) : ?>
<?		$str_day = str_pad($day, 2, '0', STR_PAD_LEFT); ?>
											<option value="<?=$str_day?>" <?=$user['birth_dd'] == $str_day ? 'selected="selected"' : '';?>><?=$day?></option>
<?	endfor ?>
										</select>일
										<select name="birth_hh" id="birth_hh" title="출생시간을 선택하세요" class="input_select">
											<option value="0" <?=$user['birthtime'] == '0' ? 'selected="selected"' : ''?>>모름</option>
											<option value="01" <?=$user['birthtime'] == '01' ? 'selected="selected"' : ''?>>子 (23:30 ~ 01:29)</option>
											<option value="02" <?=$user['birthtime'] == '02' ? 'selected="selected"' : ''?>>丑 (01:30 ~ 03:29)</option>
											<option value="04" <?=$user['birthtime'] == '04' ? 'selected="selected"' : ''?>>寅 (03:30 ~ 05:29)</option>
											<option value="06" <?=$user['birthtime'] == '06' ? 'selected="selected"' : ''?>>卯 (05:30 ~ 07:29)</option>
											<option value="08" <?=$user['birthtime'] == '08' ? 'selected="selected"' : ''?>>辰 (07:30 ~ 09:29)</option>
											<option value="10" <?=$user['birthtime'] == '10' ? 'selected="selected"' : ''?>>巳 (09:30 ~ 11:29)</option>
											<option value="12" <?=$user['birthtime'] == '12' ? 'selected="selected"' : ''?>>午 (11:30 ~ 13:29)</option>
											<option value="14" <?=$user['birthtime'] == '14' ? 'selected="selected"' : ''?>>未 (13:30 ~ 15:29)</option>
											<option value="16" <?=$user['birthtime'] == '16' ? 'selected="selected"' : ''?>>申 (15:30 ~ 17:29)</option>
											<option value="18" <?=$user['birthtime'] == '18' ? 'selected="selected"' : ''?>>酉 (17:30 ~ 19:29)</option>
											<option value="20" <?=$user['birthtime'] == '20' ? 'selected="selected"' : ''?>>戌 (19:30 ~ 21:29)</option>
											<option value="22" <?=$user['birthtime'] == '22' ? 'selected="selected"' : ''?>>亥 (21:30 ~ 23:29)</option>
										</select>시
										<br><label class="error" for="birth_yyyy" generated="true"></label>
										<label class="error" for="birth_mm" generated="true"></label>
										<label class="error" for="birth_dd" generated="true"></label>
								   	</td>
								</tr>
								<tr>
									<th scope="row">양력/음력</th>
									<td>
										<select name="birth_solunar" id="birth_solunar" title="음/양을 선택하세요" class="input_select">
											<option value="S_C" <?=$user['birth_solunar'] == 'S' && $user['cl_year'] == 'C' ? 'selected="selected"' : ''?>>양력</option>
											<option value="L_C" <?=$user['birth_solunar'] == 'L' && $user['cl_year'] == 'C' ? 'selected="selected"' : ''?>>음력(평달)</option>
											<option value="L_L" <?=$user['birth_solunar'] == 'L' && $user['cl_year'] == 'L' ? 'selected="selected"' : ''?>>음력(윤달)</option>
										</select>
									</td>
								</tr>
<?	if ($is_tojung == TRUE) : ?>
								<tr class="year">
									<th scope="row" >당해연도</th>
									<td>
										 <select name="target_yyyy" id="target_yyyy" title="토정비결을 보고싶은 해당년도를 선택하세요" class="input_select">
											<option value="2012" selected="selected">2012</option>
											<option value="2013">2013</option>
											<option value="2014">2014</option>
											<option value="2015">2015</option>
											<option value="2016">2016</option>
											<option value="2017">2017</option>
											<option value="2018">2018</option>
											<option value="2019">2019</option>
											<option value="2020">2020</option>
											<option value="2021">2021</option>
										</select>
									</td>
								</tr>
<?	else : ?>
								<tr style="display:none;">
									<th scope="row" >당해연도</th>
									<td>
										<input type="hidden" name="target_yyyy" id="target_yyyy" readonly="readonly" value="<?=date("Y",time());?>" / class="input_select">
									</td>
								</tr>
<?	endif ?>
							</tbody>
						</table>
					</fieldset>	

					<fieldset class="you">
						<legend>상대방의 사주정보</legend>
						<table width="100%" summary="" cellpadding="0" cellspacing="0">
							<colgroup>
								<col width="85" />
								<col width="*" />
							</colgroup>
							<tbody>
								<tr>
<?	if ($is_star_gunghap) : ?>
									<td colspan="3" class="title"><img src="/images/common/sstit_starinfo.png" alt="스타의 사주정보" /></td>
<?	else : ?>
									<td colspan="3" class="title"><img src="/images/common/sstit_youinfo.png" alt="상대방의 사주정보" /></td>
<?	endif ?>
								</tr>
								<tr>
									<th scope="row">
										<label for="your_name">이름</label>
									</th>
									<td>
										<input type="text" name="your_name" id="your_name" value="<?=$your_name?>" class="inpText" />
<?	if ($is_star_gunghap) : ?>
										<span><a href="javascript:;" onclick="openStarSearch()"><img src="/images/common/bt_star.png" alt="스타찾기" align="top" /></a></span>
<?	endif ?>
										<label class="error" for="your_name" generated="true"></label>
									</td>
								</tr>
								<tr>
									<th scope="row">
										<label for="user_sex">성별</label>
									</th>
									<td>
										<input type="radio" name="your_sex" id="your_sex_m" value="남" class="input_radio" <?=$your_sex == '남' ? 'checked="checked"' : '' ?> />
										<label for="your_sex_m">남자</label>
										<input type="radio" name="your_sex" id="your_sex_f" value="여" class="input_radio" <?=$your_sex == '여' ? 'checked="checked"' : '' ?> />
										<label for="your_sex_f">여자</label>
										<label class="error" for="your_sex" generated="true"></label>
									</td>
								</tr>
								<tr>
									<th scope="row">
										<label for="user_birth">생년월일시</label>
									</th>
									<td>
										<select name="your_birth_yyyy" id="your_birth_yyyy" title="출생년도를 선택하세요" class="input_select">
											<option value="">출생년도</option>
<?	for ($year = 1930; $year <= 2012; $year++) : ?>
											<option value="<?=$year?>" <?=$your_birth_yyyy == $year ? 'selected="selected"' : '';?>><?=$year?></option>
<?	endfor ?>
										</select>년
										<select name="your_birth_mm" id="your_birth_mm" title="출생월을 선택하세요" class="input_select">
											<option value="">출생월</option>
<?	for ($month = 1; $month <= 12; $month++) : ?>
<?		$str_month = str_pad($month, 2, '0', STR_PAD_LEFT); ?>
											<option value="<?=$str_month?>" <?=$your_birth_mm == $str_month ? 'selected="selected"' : '';?>><?=$month?></option>
<?	endfor ?>
										</select>월
										<select name="your_birth_dd" id="your_birth_dd" title="출생일을 선택하세요" class="input_select bottom">
											<option value="">출생일</option>
<?	for ($day = 1; $day <= 31; $day++) : ?>
<?		$str_day = str_pad($day, 2, '0', STR_PAD_LEFT); ?>
											<option value="<?=$str_day?>" <?=$your_birth_dd == $str_day ? 'selected="selected"' : '';?>><?=$day?></option>
<?	endfor ?>
										</select>일
										<select name="your_birth_hh" id="your_birth_hh"  class="input_select">
											<option value="0">모름</option>
											<option value="01"> 子 (23:30 ~ 01:29)</option>
											<option value="02"> 丑 (01:30 ~ 03:29)</option>
											<option value="04"> 寅 (03:30 ~ 05:29)</option>
											<option value="06"> 卯 (05:30 ~ 07:29)</option>
											<option value="08"> 辰 (07:30 ~ 09:29)</option>
											<option value="10"> 巳 (09:30 ~ 11:29)</option>
											<option value="12"> 午 (11:30 ~ 13:29)</option>
											<option value="14"> 未 (13:30 ~ 15:29)</option>
											<option value="16"> 申 (15:30 ~ 17:29)</option>
											<option value="18"> 酉 (17:30 ~ 19:29)</option>
											<option value="20"> 戌 (19:30 ~ 21:29)</option>
											<option value="22"> 亥 (21:30 ~ 23:29)</option>
										</select>시
										<br><label class="error" for="your_birth_yyyy" generated="true"></label>
										<label class="error" for="your_birth_mm" generated="true"></label>
										<label class="error" for="your_birth_dd" generated="true"></label>
									</td>
								</tr>

								<tr <?=$is_star_gunghap ? 'style="display:none;"' : '' ?>>
									<th scope="row">양력/음력</th>
									<td>
										<select name="your_birth_solunar" id="your_birth_solunar" title="음/양을 선택하세요" class="input_select">
											<option value="S_C">양력</option>
											<option value="L_C">음력(평달)</option>
											<option value="L_L">음력(윤달)</option>
										</select>
									</td>
								</tr>
								<tr style="display:none;">
									<th scope="row" >당해연도</th>
									<td>
										<input type="hidden" name="target_yyyy" id="target_yyyy" readonly="readonly" value="<?=date("Y",time());?>" class="input_select" />
									</td>
								</tr>
							</tbody>
						</table>
					</fieldset>	
					<div class="bt">
	                    <a href="javascript:;" onclick="window.open('/static/unse/<?=$category['sub']?>_<?=$category['cont']?>_prev_pop.php','','width=800,heigth=1000,scrollbars=yes')"><img src="/images/common/bt_prev.png" alt="미리보기" /></a>
    	                <input type="image" src="/images/common/bt_result.png" alt="결과보기" />

						<!--유의사항 팝업-->
						<script type="text/javascript">
							$(document).ready(function(){
								$("#btnOk").bind({
									mouseover: function() {
										$(".bt_pop").show();
									},
									mouseout: function() {
										$(".bt_pop").hide();
									}
								});
							});
						</script>
						<div class="bt_pop" style="display: none">
							<p><Img src="/images/sub/common/emak.png" alt="경고아이콘" align="absmiddle" /></p>
<?	if ($category['sub'] == 'money') : ?>
							<p class="money">금전궁합은 1987년생부터 이용가능합니다.</p>
<?	endif ?>
							<p>결제완료 후에는 <em>'새로 고침'</em> 또는 <br /><em>'뒤로'</em> 버튼을 누르지 마시기 바랍니다.<br />(사용자의 실수에 대해서는 환불되지 않습니다.)</p>
						</div>
						<!--// 유의사항 팝업-->
                    </div><!--bt-->
				</form><!--상대방사주정보-->
			</div><!--information--> 
